home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1997 August
/
Macworld (1997-08).dmg
/
Serious Demos
/
Crimson Demo
/
Crimson Demos
/
ListBox Demo
/
MainProg
< prev
next >
Wrap
Text File
|
1997-06-17
|
2KB
|
68 lines
*************************
* *
* Event - OnMenu *
*************************
Procedure DemoForm.OnMenu(MenuId,ItemNo)
Parameter MenuId As Integer
Parameter ItemNo As Integer
If (MenuId=FileMenu) And (ItemNo=QuitItem)
Do DemoForm.QuitBtn.Click
Endif
Return
*************************
* *
* Event - QuitBtn.Click *
*************************
Procedure DemoForm.QuitBtn.Click()
DemoForm.CloseWindow
End
REturn
*************************
* *
* Event - AddBtn.Click *
*************************
Procedure DemoForm.AddBtn.Click()
Local InputValue As String [30]
* Get the string in the Edititable Text field (InputBox) and Insert it at
* start of the list.
InputValue=DemoForm.InputBox.Value
If InputValue<>""
DemoForm.ListBox.InsertRow(1,InputValue)
Endif
Return
*************************
* *
* Event - DelBtn.Click *
*************************
Procedure DemoForm.DelBtn.Click()
Local NextRow As Integer
* Delete all selected rows
NextRow=1
Repeat
NextRow=DemoForm.ListBox.GetSelected(NextRow)
If NextRow<>0
DemoForm.ListBox.DeleteRow(NextRow,1)
Endif
Until NextRow=0
Return
***************************
* *
* Event - CheckBox.MouseDown *
***************************
Procedure DemoForm.CheckBox.MouseDown
Local State As Integer
* Set multi-select status of list box depending on the state of the
* check box
State=DemoForm.CheckBox.Value
DemoForm.ListBox.MultiSel=State
Return